import time
from po_A3mall.Base.Base import Base
from selenium.webdriver.common.by import By

class Page1(Base):
    login_loc = (By.XPATH,'/html/body/div[1]/div/div[2]/ul/li[1]/a')
    def login(self):
        self.click(self.login_loc)

    username_loc = (By.NAME,'username')
    def username(self):
        self.send_keys(self.username_loc,'15235688537')

    password_loc = (By.NAME,'password')
    def password(self):
        self.send_keys(self.password_loc,'a123123')

    loginbtn_loc = (By.XPATH,'//*[@id="theForm"]/div[5]/a')
    def loginbtn(self):
        self.click(self.loginbtn_loc)

    dy1_loc = (By.XPATH,'/html/body/div[1]/div/div[2]/ul/li[1]/a')
    def dy1(self):
        self.text(self.dy1_loc)

    def A3mall_01(self):
        self.open('http://10.59.9.12:7001/')
        time.sleep(1)
        self.login()
        time.sleep(1)
        self.username()
        self.password()
        time.sleep(15)
        self.loginbtn()
        time.sleep(3)
        print(self.dy1())